<extend name="Public:base" />
<block name="header_js">
<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function(){
    var ue = UE.getEditor('inputContent',{
        serverUrl :"{:U('Public/editorMethod')}"
    });
    UE.getEditor('inputEnContent',{
        serverUrl :"{:U('Public/editorMethod')}"
    });
})
</script>

<script type="text/javascript" src="__PUBLIC__/js/calendar.config.js"></script>
<script type="text/javascript" src="__DATA__/static/jq_plugins/iColorPicker/iColorPicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/XYHUploader/XYHUploader.js"></script>

<script type="text/javascript">
$(function () {
	//缩略图上传
	$('#litpic').XYHUploader({
		sfile:"img1", 
		furl:"{:U('Public/upload',array('img_flag' => 1))}", 
		burl:"{:U('Public/browseFile', array('stype' => 'picture'))}",
		thide: false,
		thumflag: true
	});

	$('#CK_JumpUrl').click(function(){
            if($(this).prop('checked')) {
                $('#JumpUrlDiv').show();

            }else {
                $('#JumpUrlDiv').hide();
            }
            
     });
	
});







</script>
	
</block>

<block name="content">



	<div class="row  row_box">
		<div class="col-lg-12">
			<h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
			修改文章  
		    </h3>
		</div>
		
		
	<div class="box_h">

<span class="navbar-text">切换：</span>

	<ul>
		<li class="cnbox"><a href="javascript:volid(0);">中文</a></li>
		<li class="enbox"><a href="javascript:volid(0);">英文</a></li>
	</ul>

</div>	
		
	</div>


	<div class="row">
		<div class="col-lg-12">

				<form method='post' class="form-horizontal" id="form_do" name="form_do" action="{:U('edit')}">
					<!-- CN BOX -->
					<div class="cn_box">
						<div class="form-group">
							<label for="inputTtitle" class="col-sm-2 control-label">内容标题</label>
							<div class="col-sm-9">
								<input type="text" name="title" id="inputTtitle" value="{$vo.title}" class="form-control" placeholder="标题" required="required" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputShorttitle" class="col-sm-2 control-label">副标题</label>
							<div class="col-sm-9">
								<input type="text" name="short_title" id="inputShorttitle" value="{$vo.short_title}" class="form-control" placeholder="副标题" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputColor" class="col-sm-2 control-label">标题颜色</label>
							<div class="col-sm-5">
								<input type="text" name="color" id="inputColor" value="{$vo.color}" class="form-control  iColorPicker" placeholder="标题颜色" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputColor" class="col-sm-2 control-label">自定义属性</label>
							<div class="col-sm-9">
								<foreach name='flagtypelist' item='v'>
									<label class="checkbox-inline"><input type='checkbox' name='flags[]' value='{$key}' <if condition="$key eq B_JUMP">id="CK_JumpUrl"</if> <if condition="($vo['flag'] & $key) eq $key">checked="checked"</if> /> {$v}</label>
								</foreach>
							</div>
						</div>
						<div class="form-group" id="JumpUrlDiv" <if condition="($vo['flag'] & B_JUMP) eq 0">style="display:none;"</if>>
							<label for="inputJumpurl" class="col-sm-2 control-label">跳转网址</label>
							<div class="col-sm-9">
								<input type="text" name="jump_url" id="inputJumpurl" value="{$vo.jump_url}" class="form-control" placeholder="跳转网址" />
							</div>
						</div>
						<div class="form-group">
						<label for="inputProName" class="col-sm-2 control-label">所属栏目</label>
						<div class="col-sm-9">
							<select name="cid" class="form-control">
								<volist name="cate" id="v">
									<option value="{$v.id}" <if condition="$vo['cid'] eq $v['id']">selected="selected"</if>>{$v.delimiter}{$v.name}</option>
								</volist>
							</select>
						</div>
					</div>
						<div class="form-group">
						<label for="litpic" class="col-sm-2 control-label">缩略图</label>
						<div class="col-sm-9">
							<input type="text" class="form-control" name="litpic" id="litpic"   value="{$vo.litpic}" placeholder="缩略图地址" />
						</div>
					</div>
						<div class="form-group">
						<label for="inputKeywords" class="col-sm-2 control-label">关键词</label>
						<div class="col-sm-9">
							<input type="text" name="keywords" id="inputKeywords" class="form-control" value="{$vo.keywords}" placeholder="多关键词之间用“,”隔开" />
						</div>
					</div>
						<div class="form-group">
						<label for="inputDescription" class="col-sm-2 control-label">摘要</label>
						<div class="col-sm-9">
							<textarea name="description" id="inputDescription" class="form-control">{$vo.description}</textarea>
						</div>
					</div>
						<div class="form-group">
						<label for="inputAuthor" class="col-sm-2 control-label">作者</label>
						<div class="col-sm-9">
							<input type="text" name="author" id="inputAuthor" class="form-control"  value="{$vo.author}" placeholder="作者" />
						</div>
					</div>
						<div class="form-group">
						<label for="inputCopyfrom" class="col-sm-2 control-label">来源</label>
						<div class="col-sm-9">
							<input type="text" name="copyfrom" id="inputCopyfrom" class="form-control"  value="{$vo.copyfrom}" placeholder="来源" />
						</div>
					</div>
						<div class="form-group">
						<label for="inputContent" class="col-sm-2 control-label">内容</label>
						<div class="col-sm-9">
							<textarea name="content" id="inputContent" style="height: 370px;">{$vo.content}</textarea>
						</div>
					</div>
						<div class="form-group">
							<label for="inputPublishtime" class="col-sm-2 control-label">发布时间</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" name="publish_time" id="inputPublishtime" value="{$vo.publish_time}">
								<script type="text/javascript">
									Calendar.setup({
										weekNumbers: true,
										inputField : "inputPublishtime",
										trigger    : "inputPublishtime",
										dateFormat: "%Y-%m-%d %H:%M:%S",
										showTime: true,
										minuteStep: 1,
										onSelect   : function() {this.hide();}
									});
								</script>
							</div>
						</div>
						<div class="form-group">
							<label for="inputShorttitle" class="col-sm-2 control-label">权重</label>
							<div class="col-sm-2">
								<input type="text" name="point" id="inputPoint" value="{$vo.point}" class="form-control" placeholder="权重" />
							</div>
							<div class="col-sm-7">
								<label class="checkbox-inline">权重用于排序，从大到小，排序优先</label>
							</div>
						</div>
						<div class="form-group">
							<label for="inputName" class="col-sm-2 control-label">评论</label>
							<div class="col-sm-9">
								<label class="radio-inline">
									<input type="radio" name="comment_flag" value="1" <if condition="$vo['comment_flag'] eq 1">checked="checked"</if> />允许
								</label>
								<label class="radio-inline">
									<input type="radio" name="comment_flag" value="0"  <if condition="$vo['comment_flag'] eq 0">checked="checked"</if> />禁止
								</label>
							</div>
						</div>
					</div>
					<!-- / CN BOX -->
					<!-- EN BOX -->
					<div class="en_box">
						<div class="form-group">
							<label for="inputEnTtitle" class="col-sm-2 control-label">英文内容标题</label>
							<div class="col-sm-9">
								<input type="text" name="en_title" id="inputEnTtitle" value="{$vo.en_title}" class="form-control" placeholder="英文标题" required="required" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnShorttitle" class="col-sm-2 control-label">英文副标题</label>
							<div class="col-sm-9">
								<input type="text" name="en_short_title" id="inputEnShorttitle" value="{$vo.en_short_title}" class="form-control" placeholder="英文副标题" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnKeywords" class="col-sm-2 control-label">英文关键词</label>
							<div class="col-sm-9">
								<input type="text" name="en_keywords" id="inputEnKeywords" class="form-control" value="{$vo.en_keywords}" placeholder="多关键词之间用“,”隔开" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnDescription" class="col-sm-2 control-label">英文摘要</label>
							<div class="col-sm-9">
								<textarea name="en_description" id="inputEnDescription" class="form-control">{$vo.en_description}</textarea>
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnAuthor" class="col-sm-2 control-label">英文作者</label>
							<div class="col-sm-9">
								<input type="text" name="en_author" id="inputEnAuthor" class="form-control"  value="{$vo.en_author}" placeholder="英文作者" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnCopyfrom" class="col-sm-2 control-label">英文来源</label>
							<div class="col-sm-9">
								<input type="text" name="en_copyfrom" id="inputEnCopyfrom" class="form-control"  value="{$vo.en_copyfrom}" placeholder="英文来源" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEnContent" class="col-sm-2 control-label">内容</label>
							<div class="col-sm-9">
								<textarea name="en_content" id="inputEnContent" style="height: 370px;">{$vo.en_content}</textarea>
							</div>
						</div>
					</div>
					<!-- / EN BOX -->

					<div class="row margin-botton-large">
						<div class="col-sm-offset-2 col-sm-9">
							<input type="hidden" name="id" value="{$vo.id}" />
							<input type="hidden" name="pid" value="{$pid}" />
							<div class="btn-group">
								<button type="submit" class="btn btn-primary"> <i class="glyphicon glyphicon-saved"></i>
									保存
								</button>
								<button type="button" onclick="goUrl('{:U('index')}')" class="btn btn-default"> <i class="glyphicon glyphicon-chevron-left"></i>
									返回
								</button>
							</div>
						</div>
					</div>
				</form>
		</div>
	</div>
</block>
<block name="out_foot">
	<script>
        $(document).ready(function () {
            $('.en_box').hide();
			$('.cnbox').addClass('hover'); //默认给中文加hover
            $('.enbox').click(function () {
                $('.cn_box').hide();
                $('.en_box').show();
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');					
            });
            $('.cnbox').click(function () {
                $('.cn_box').show();
                $('.en_box').hide();
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');					
            });
        });
	</script>
</block>